#ifndef __OLED_MENU_H
#define __OLED_MENU_H

#include "at32f435_437_board.h"
#include "u8g2.h"

#include "buzzer_control.h"

#include "pid_menu_handler.h"

#define FONT_HEIGHT 11
#define FRAME_NUM 8
#define FRAME_X_SEG (128 / FRAME_NUM)
#define FRAME_Y_SEG (FONT_HEIGHT / (float)FRAME_NUM)

typedef struct
{
  uint8_t menu_len;
  void (*init_func)(void);
} menu_meta_t;

typedef struct
{
  menu_meta_t *menu_meta;
  char disp_str[16];
  void (*func0)(uint8_t select_item);
  void (*func1)(uint8_t select_item);
  struct menu_t *children_menu;
} menu_t;

void menu_init(void);
void menu_refresh(void);
void menu_up(void);
void menu_down(void);
void menu_go(void);
void menu_back(void);
void menu_dialog(const char* str, const char* str2);

void say_hello(uint8_t select_item);

#endif // __OLED_MENU_H